<form action="" {ife 'sns.manage' $item}action="" method="post"{/if}  class="form-horizontal form-validate" enctype="multipart/form-data">
<input type="hidden" name="id" value="{$item['id']}" />
<input type="hidden" name="r" value="sns.manage.{if empty($item['id'])}add{else}edit{/if}" />
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button data-dismiss="modal" class="close" type="button">×</button>
            <h4 class="modal-title">{if !empty($item['id'])}编辑{else}添加{/if}版主</h4>
        </div>
        <div class="modal-body">
            <div class="form-group">
                <label class="col-sm-2 control-label must">版块</label>
                <div class="col-sm-9 col-xs-12">
                    {ife 'sns.manage' $item}
                    <select name="bid" class="select2" data-rule-required="true" style="width:390px;">
                        <option value="">--请选择版块--</option>
                        {loop $boards $b}
                        <option value="{$b['id']}" {if $b['id']==$item['bid']}selected{/if}>{$b['title']}</option>
                        {/loop}
                    </select>
                    {else}
                        {loop $boards $b}
                            {if $b['id']==$item['bid']}{$b['title']}{/if}
                        {/loop}
                    {/if}
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label must">选择会员</label>
                <div class="col-sm-9 col-xs-12">
                    {ife 'sns.manage' $item}
                    {php echo tpl_selector('openid',array('key'=>'openid','text'=>'nickname', 'required'=>true, 'thumb'=>'avatar','placeholder'=>'昵称/姓名/手机号','buttontext'=>'选择会员', 'items'=>$member,'url'=>webUrl('member/query') ))}
                    {else}
                    <div class='form-control-static'>{$member['nickname']} / {$member['realname']} / {$member['mobile']}</div>
                    {/if}
                </div>
            </div>
            </div>

        <div class="modal-footer">
            <button class="btn btn-primary" type="submit">提交</button>
            <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
        </div>    </div>
    </div>
    </form>

<script lang="javascript">
    $('form').submit(function(){
        if( $('select[name=bid]').isEmpty()){
            $('form').attr('stop',1);
            tip.msgbox.err('请选择版块!');
            return false;
        }
        $('form').removeAttr('stop');
        return true;
    })
</script>
